#include <STC15F2K60S2.H>
#include "smg.h"
#include "Timer0.h"

unsigned char Time = 100;

void main()
{
	P2 = 0xA0;	P0 = 0x00;	//初始化，关闭蜂鸣器继电器
	P2 = 0x80;	P0 = 0xFF;	//Y4=0;选中LED，使其灭
	Timer0_Init();
	
	
	while(1)
	{
		DJS_Show(Time/100, Time/10%10, Time%10);
	}
}



void Timer0_Rountine(void) interrupt 1
{	//5ms定时
	static unsigned int Count0;

	Count0++;
	if(Count0 >= 200)	//1s
	{
		Time--;
		Count0 = 0;	//软件复位
	}
}





/*
//数码管段选
	P27 = 1; P26 = 1; P25 = 0;	//Y6=0;Y6C=1; 使能锁存器U8
	P00 = 1; P04 = 1;			//选中第一个数码管
	//数码管位选
	P27 = 1; P26 = 1; P25 = 1;	//Y7=0;Y7C=1; 使能锁存器U7
	P0 = 0xC0;					//显示0
*/